# To change this template, choose Tools | Templates
# and open the template in the editor.

import logging
import os
from google.appengine.ext.webapp import template
from qsiauth import constants

__author__="mtu"
__date__ ="$Jul 13, 2013 10:14:59 PM$"


def handle_404(request, response, exception):
    logging.exception(exception)
    data = {"msg": 'Page Not Found','title':constants.TITLE}
    path = os.path.join(os.path.dirname(__file__), 'templates/404.html')
    response.out.write(template.render(path, data))
    response.set_status(404)

def handle_500(request, response, exception):
    logging.exception(exception)
    data = {"msg": 'Server Error','title':constants.TITLE}
    path = os.path.join(os.path.dirname(__file__), 'templates/500.html')
    response.out.write(template.render(path, data))
    response.set_status(500)
